package com.aaa.ssm.service.impl;

import com.aaa.ssm.dao.NechannlDao;
import com.aaa.ssm.entity.Dicgchannel;
import com.aaa.ssm.entity.TDicNechannel;
import com.aaa.ssm.service.NechannlServiel;
import com.aaa.ssm.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ fileName:NechannlServielImpl
 * @ description: 咨询栏目表
 * @ createTime:2023/4/4 15:01
 * @ version:1.0.0
 */
@Service
public class NechannlServielImpl implements NechannlServiel {

    @Resource
    private NechannlDao nechannlDao;

    /**
     * 分页带参查询
     * @param page
     * @return
     */
    @Override
    public PageInfo queryAll(Page<TDicNechannel> page) {
        PageHelper.startPage(page.getPageNo(),page.getPageSize());
        return new PageInfo(nechannlDao.queryAll(page.getData()));
    }
    @Override
    public int add(Dicgchannel dicgchannel) {
        return nechannlDao.add(dicgchannel);
    }

    @Override
    public int update(Dicgchannel dicgchannel) {
        return nechannlDao.update(dicgchannel);
    }

    @Override
    public int delete(String code) {
        return nechannlDao.delete(code);
    }
}
